package com.example.service.impl.courseServiceImpl;

import com.example.dao.courseDao.CourseLogDao;
import com.example.pojo.coursePojo.CourseLog;
import com.example.service.courseService.CourseLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @Author:郭
 * @Description: TODO
 * @Date: 2022/12/8 10:31
 * @ClassName CourseLogServiceImpl
 * 课程日志表
 */
@Service
public class CourseLogServiceImpl implements CourseLogService {
    @Autowired
    private CourseLogDao courseLogDao;
    /**
     * @Author: 郭
     * @Date: 2022/12/8 10:34
     * @Param:
     * @Return: List<CourseLog>
     * 课程日志表中的全查数据
     */
    @Override
    public List<CourseLog> getAll() {
        return courseLogDao.getAll();
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/8 10:35
     * @Param:
     * @Return: int
     * 课程日志表中的总数据
     */
    @Override
    public int getCount() {
        return courseLogDao.getCount();
    }
    /**
     * @Author: 郭
     * @Date: 2022/12/19 18:23
     * @Param: courseLog
     * @Return: int
     * 添加课程的时候添加一条日志
     */
    @Override
    public int insertCourseLog(CourseLog courseLog) {
        courseLog.setCourseDate(new Date());
        return courseLogDao.insertCourseLog(courseLog);
    }
}
